/**
 * 
 */
package com.gcb.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gcb.domain.Department;
import com.gcb.domain.Employee;
import com.gcb.repository.DepartmentRepository;
import com.gcb.repository.EmployeeRepository;
import com.gcb.service.EmployeeService;

/**
 * @author Cre.Gu
 * 
 */
@Service
public class EmployeeServiceImpl implements EmployeeService {
	protected static final org.slf4j.Logger log = org.slf4j.LoggerFactory
			.getLogger(EmployeeServiceImpl.class);

	@Resource
	private EmployeeRepository employeeRepository;
	@Resource
	private DepartmentRepository departmentRepository;

	@Override
	public void save() {
		Department d = Department.create();
		Employee e = Employee.create();

		e.setDepartment(d);

		departmentRepository.save(d);
		employeeRepository.save(e);
	}

}
